<template>
    <view class="img-test">
        图片上传测试
        <uploader-image
            :ossPathPrefix="'test/yzom_img/APPLET/task_dtl/'"
            :photoList="phototList"
            :isUploaderOss="true"
            :maxCount="3"
            :ref="oploaderOss"
            :upload-icon="'photograph'"
            @uploadSuccess="uploadImageSuccess"
        />
        视频上传测试
        <!-- 上传视频不能超过4M -->
        <uploader-image
            :compressMaxSize="1024 * 1024 * 4"
            :ossPathPrefix="'yzom_img/APPLET/task_dtl/'"
            :photoList="vidoeList"
            :isUploaderOss="true"
            :maxCount="1"
            :accept="'video'"
            ref="oploaderOss "
            :upload-icon="'play-circle'"
            @uploadSuccess="uploadVideoSuccess"
        />
    </view>
</template>

<script>
import UploaderImage from '@/components/UploaderImage';

export default {
    name: 'ImgTest',
    components: { UploaderImage },
    data() {
        return {
            phototList: [],
            vidoeList: []
        };
    },
    onLoad() {
    },
    methods: {
        // 图片上传成功返回
        uploadImageSuccess(fileList) {
            console.log('fileList----', fileList);
            this.phototList = fileList;
        },
        // 图片上传成功返回
        uploadVideoSuccess(fileList) {
            console.log('fileList----', fileList);
            this.vidoeList = fileList;
        }
    }
};
</script>

<style scoped lang="scss">
    .img-test{
        padding:15rpx;
    }
</style>
